var express = require('express');
var router = express.Router();
/* GET home page. */
var multiparty = require('multiparty');

// 相册选择视频上传
router.post('/video_post',async(req,res)=>{
  let form = new multiparty.Form()
  form.uploadDir = 'upload'
  form.parse(req, (err, a, b) => {
    res.send({
      code: 200,
      msg: "http://localhost:4000/" + b.file[0].path,
    }) 
  })
}),

// 录制视频上传
router.post('/luzhi_video_post',async(req,res)=>{
  let form = new multiparty.Form()
  form.uploadDir = 'upload'
  form.parse(req, (err, a, b) => {
    res.send({
      code: 200,
      msg: "http://localhost:4000/" + b.video[0].path,
    })
  })
})




module.exports = router;
 